<!-- 父组件 -->

<template>
    <h2>{{ value }}</h2>
    <input type="text" v-model="value">
    <button @click="value='nb666修改'">点击</button>
    <zhizujian v-model="value"></zhizujian>

</template>



<script lang="ts" >
    export default {
        name:"组件",
    }


</script>

<script lang="ts" setup>
import { ref } from "vue";
import { watch } from "vue";
import zhizujian from "./组件-2.vue"

const value= ref("nb666")
// const nb777=ref("");

watch(value, (newVal, oldVal) => {
    console.log("nb666的值发生了变化", newVal, oldVal)
})


</script>